import React from 'react';
import {BrowserRouter as Router, Route,Link} from 'react-router-dom'
import 'css/CreateQust.css';
import CreateBox from "page/createbox/CreateBox";

export default class CreateQust extends React.Component{


  constructor(props) {
    super(props);
    this.state = {
      item:1
    }
    this.addItem = this.addItem.bind(this);

  }


  addItem(param){

    console.log("====================================================addItem = "+param);

    this.setState({
      item:param
    })

  }

  componentDidMount() {


    console.log("=================================  componentDidMount")
  }

  componentDidUpdate() {

    console.log("======================================= componentDidUpdate")
  }

  render(){
    console.log('=======================================CreateQust   render1')
    return <section id='create_qust'>
      <div className='choose_box'>
        <ul>
          <li><input id="nom_input" className='add_button' type='button' value='普通输入框' onClick={()=>this.addItem(1)}/></li>
          <li><input id="big_text" className='add_button' type='button' value='大文本输入框' onClick={()=>this.addItem(2)}/></li>
          <li><input id="sig_box" className='add_button' type='button' value='单选框' onClick={()=>this.addItem(3)}/></li>
          <li><input id="more_box" className='add_button' type='button' value='多选框' onClick={()=>this.addItem(4)}/></li>
          <li><input id='slide' className='add_button' type='button' value='滑动条' onClick={()=>this.addItem(5)}/></li>
        </ul>
      </div>
      <div className='qust_all'>
        <label>标题</label><input className='temp_title'/>
        <div className='qust_some_des'>
         <label>创建人：</label> <span className='create_user qu_de'>桂臣</span>
          <label>创建时间:</label><span className='create_time qu_de'>2020/05/08</span>
          <label>结束时间:</label><input type='date' className='over_time qu_de'/>
          <label>简述:</label><input type='text' className='description qu_de'/>
          <label>开启</label><input type="checkbox" id="check1"/>
        </div>
        <CreateBox newitem={this.state.item}/>
      </div>
    </section>
  }
}
